Optimal. Leaf size=36 \[ a^2 (-x)-\frac{(a+b)^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0803038, antiderivative size = 36, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {4141, 1802, 203} \[ a^2 (-x)-\frac{(a+b)^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4141
Rule 1802
Rule 203
Rubi steps
\begin{align*} \int \cot ^2(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b \left (1+x^2\right )\right )^2}{x^2 \left (1+x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (b^2+\frac{(a+b)^2}{x^2}-\frac{a^2}{1+x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{(a+b)^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f}-\frac{a^2 \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=-a^2 x-\frac{(a+b)^2 \cot (e+f x)}{f}+\frac{b^2 \tan (e+f x)}{f}\\ \end{align*}
Mathematica [B] time = 0.69248, size = 82, normalized size = 2.28 \[ -\frac{4 \sec (e+f x) \left (a \cos ^2(e+f x)+b\right )^2 \left (a^2 f x \cos (e+f x)-\sin (f x) \left ((a+b)^2 \csc (e) \cot (e+f x)+b^2 \sec (e)\right )\right )}{f (a \cos (2 (e+f x))+a+2 b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.049, size = 66, normalized size = 1.8 \begin{align*}{\frac{1}{f} \left ({a}^{2} \left ( -\cot \left ( fx+e \right ) -fx-e \right ) -2\,ab\cot \left ( fx+e \right ) +{b}^{2} \left ({\frac{1}{\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) }}-2\,\cot \left ( fx+e \right ) \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.47566, size = 62, normalized size = 1.72 \begin{align*} -\frac{{\left (f x + e\right )} a^{2} - b^{2} \tan \left (f x + e\right ) + \frac{a^{2} + 2 \, a b + b^{2}}{\tan \left (f x + e\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.488268, size = 153, normalized size = 4.25 \begin{align*} -\frac{a^{2} f x \cos \left (f x + e\right ) \sin \left (f x + e\right ) +{\left (a^{2} + 2 \, a b + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - b^{2}}{f \cos \left (f x + e\right ) \sin \left (f x + e\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \sec ^{2}{\left (e + f x \right )}\right )^{2} \cot ^{2}{\left (e + f x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.29031, size = 66, normalized size = 1.83 \begin{align*} -\frac{{\left (f x + e\right )} a^{2} - b^{2} \tan \left (f x + e\right ) + \frac{a^{2} + 2 \, a b + b^{2}}{\tan \left (f x + e\right )}}{f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]